package main

import (
	"camera_app/api/route"
	"camera_app/bootstrap"

	"github.com/gin-contrib/cors"
	"github.com/gin-gonic/gin"
)

func main() {
	app, _ := bootstrap.NewApplication()
	G := gin.Default()
	config := cors.DefaultConfig()
	// config.AllowOrigins = []string{"*"}
	config.AllowMethods = []string{"GET", "POST", "PUT", "DELETE"}
	config.AllowHeaders = []string{"*"}
	config.AllowFiles = true
	config.AllowCredentials = true
	config.AllowAllOrigins = true

	G.Use(cors.New(config))
	route.Setup(app.DB, G)
	G.Run()
}
